export interface SearchInfo {
	userId?: number;
	phone?: string;
	code?: string;
	source?: number;
	gender?: string;
	// 对齐后端 UserAllQueryVo 查询条件
	type?: string;
	heightFrom?: number;
	heightTo?: number;
	ageFrom?: number;
	ageTo?: number;
	weightFrom?: number;
	weightTo?: number;
	profession?: string;
	incomeStatus?: string;
	carHouseStatus?: string;
	maritalStatus?: string;
	provinceId?: number;
	cityId?: number;
	districtId?: number;
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{
		title: '用户编码',
		dataIndex: 'code',
		key: 'code',
		width: 100,
		minWidth: 100,
	},
	{
		title: '手机号码',
		dataIndex: 'phone',
		key: 'phone',
		width: 180,
		minWidth: 180,
	},
	{
		title: '来源',
		dataIndex: 'source',
		key: 'source',
		align: 'center',
		width: 100,
		minWidth: 100,
	},
	{
		title: '关注公众号',
		dataIndex: 'wechatGzhOpenid',
		key: 'wechatGzhOpenid',
		align: 'center',
		width: 140,
		minWidth: 140,
	},
	{
		title: '实名认证-名称',
		dataIndex: 'identityVerificationName',
		key: 'identityVerificationName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '实名认证-身份证号',
		dataIndex: 'identityVerificationIdCardNumber',
		key: 'identityVerificationIdCardNumber',
		width: 180,
		minWidth: 180,
	},
	{
		title: '介绍人编码',
		dataIndex: 'instroPhone',
		key: 'instroPhone',
		width: 140,
		minWidth: 140,
	},
	{
		title: '介绍人编码',
		dataIndex: 'instroCode',
		key: 'instroCode',
		width: 140,
		minWidth: 140,
	},
	// 征婚档案（userProfileInfoVo）—— 放在会员标识前
	{
		title: '征婚档案-昵称',
		dataIndex: 'userProfileInfoVoNickname',
		key: 'userProfileInfoVoNickname',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-性别',
		dataIndex: 'userProfileInfoVoGender',
		key: 'userProfileInfoVoGender',
		width: 100,
		minWidth: 100,
	},
	{
		title: '征婚档案-出生年月',
		dataIndex: 'userProfileInfoVoBirthYearMonth',
		key: 'userProfileInfoVoBirthYearMonth',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-身高',
		dataIndex: 'userProfileInfoVoHeight',
		key: 'userProfileInfoVoHeight',
		width: 100,
		minWidth: 100,
	},
	{
		title: '征婚档案-体重',
		dataIndex: 'userProfileInfoVoWeight',
		key: 'userProfileInfoVoWeight',
		width: 100,
		minWidth: 100,
	},
	{
		title: '征婚档案-所在地',
		dataIndex: 'userProfileInfoVoResidenceName',
		key: 'userProfileInfoVoResidenceName',
		width: 160,
		minWidth: 160,
	},
	{
		title: '征婚档案-婚姻状况',
		dataIndex: 'userProfileInfoVoMaritalStatusName',
		key: 'userProfileInfoVoMaritalStatusName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-学历',
		dataIndex: 'userProfileInfoVoEducationLevelName',
		key: 'userProfileInfoVoEducationLevelName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-职业',
		dataIndex: 'userProfileInfoVoProfessionName',
		key: 'userProfileInfoVoProfessionName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-收入状况',
		dataIndex: 'userProfileInfoVoIncomeStatusName',
		key: 'userProfileInfoVoIncomeStatusName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-车房状况',
		dataIndex: 'userProfileInfoVoCarHouseStatusName',
		key: 'userProfileInfoVoCarHouseStatusName',
		width: 150,
		minWidth: 150,
	},
	{
		title: '征婚档案-学校',
		dataIndex: 'userProfileInfoVoSchoolName',
		key: 'userProfileInfoVoSchoolName',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-学历类型',
		dataIndex: 'userProfileInfoVoEducationTypeName',
		key: 'userProfileInfoVoEducationTypeName',
		width: 150,
		minWidth: 150,
	},
	{
		title: '征婚档案-特别说明',
		dataIndex: 'userProfileInfoVoSpecialNote',
		key: 'userProfileInfoVoSpecialNote',
		width: 220,
		minWidth: 220,
	},
	{
		title: '征婚档案-恋爱观',
		dataIndex: 'userProfileInfoVoLoveView',
		key: 'userProfileInfoVoLoveView',
		width: 200,
		minWidth: 200,
	},
	{
		title: '征婚档案-理想伴侣',
		dataIndex: 'userProfileInfoVoIdealPartner',
		key: 'userProfileInfoVoIdealPartner',
		width: 200,
		minWidth: 200,
	},
	{
		title: '征婚档案-联系电话',
		dataIndex: 'userProfileInfoVoContactPhone',
		key: 'userProfileInfoVoContactPhone',
		width: 160,
		minWidth: 160,
	},
	{
		title: '征婚档案-星座',
		dataIndex: 'userProfileInfoVoZodiac',
		key: 'userProfileInfoVoZodiac',
		width: 120,
		minWidth: 120,
	},
	{
		title: '征婚档案-显示手机号',
		dataIndex: 'userProfileInfoVoShowPhone',
		key: 'userProfileInfoVoShowPhone',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-显示微信',
		dataIndex: 'userProfileInfoVoShowWechat',
		key: 'userProfileInfoVoShowWechat',
		width: 140,
		minWidth: 140,
	},
	{
		title: '征婚档案-自动互换联系方式',
		dataIndex: 'userProfileInfoVoAutoExchangeContact',
		key: 'userProfileInfoVoAutoExchangeContact',
		width: 200,
		minWidth: 200,
	},
	{
		title: '择偶要求-年龄',
		dataIndex: 'userPartnerPreferencesVoAgeFrom',
		key: 'partnerReqAge',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-身高',
		dataIndex: 'userPartnerPreferencesVoHeightFrom',
		key: 'partnerReqHeight',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-体重',
		dataIndex: 'userPartnerPreferencesVoWeightFrom',
		key: 'partnerReqWeight',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-学历',
		dataIndex: 'userPartnerPreferencesVoEducationLevelName',
		key: 'partnerReqEducationLevel',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-职业',
		dataIndex: 'userPartnerPreferencesVoProfessionName',
		key: 'partnerReqProfession',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-收入范围',
		dataIndex: 'userPartnerPreferencesVoIncomeRangeName',
		key: 'partnerReqIncomeRange',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-车房状况',
		dataIndex: 'userPartnerPreferencesVoHousingCarStatusName',
		key: 'partnerReqHousingCarStatus',
		width: 180,
		minWidth: 180,
	},
	{
		title: '择偶要求-婚姻状况',
		dataIndex: 'userPartnerPreferencesVoMaritalStatusName',
		key: 'partnerReqMaritalStatus',
		width: 160,
		minWidth: 160,
	},
	{
		title: '择偶要求-地区',
		dataIndex: 'userPartnerPreferencesVoProvinceName',
		key: 'partnerReqRegion',
		width: 200,
		minWidth: 200,
	},

	{
		title: '会员标识',
		dataIndex: 'membershipFlag',
		key: 'membershipFlag',
		align: 'center',
		width: 90,
		minWidth: 90,
	},
	{
		title: '会员类型',
		dataIndex: 'membershipName',
		key: 'membershipName',
		align: 'center',
		width: 120,
		minWidth: 120,
	},
	{
		title: '用户会员开始时间',
		dataIndex: 'userMembershipStartTime',
		key: 'userMembershipStartTime',
		width: 160,
		minWidth: 160,
	},
	{
		title: '用户会员结束时间',
		dataIndex: 'userMembershipEndTime',
		key: 'userMembershipEndTime',
		width: 160,
		minWidth: 160,
	},
	{
		title: '红娘标识',
		dataIndex: 'matchmakerFlag',
		key: 'matchmakerFlag',
		align: 'center',
		width: 90,
		minWidth: 90,
	},
	{
		title: '红娘编码',
		dataIndex: 'matchmakerNo',
		key: 'matchmakerNo',
		width: 100,
		minWidth: 100,
	},
	{
		title: '红娘职级',
		dataIndex: 'matchmakerPositionLevelName',
		key: 'matchmakerPositionLevelName',
		width: 120,
		minWidth: 120,
	},
	{
		title: '红娘姓名',
		dataIndex: 'matchmakerName',
		key: 'matchmakerName',
		width: 120,
		minWidth: 120,
	},
	{
		title: '红娘生日',
		dataIndex: 'matchmakerBirthDate',
		key: 'matchmakerBirthDate',
		width: 140,
		minWidth: 140,
	},
	{
		title: '红娘联系电话',
		dataIndex: 'matchmakerContactPhone',
		key: 'matchmakerContactPhone',
		width: 140,
		minWidth: 140,
	},
	{
		title: '红娘入职时间',
		dataIndex: 'matchmakerEntryDate',
		key: 'matchmakerEntryDate',
		width: 140,
		minWidth: 140,
	},
	{
		title: '红娘擅长领域',
		dataIndex: 'matchmakerExpertise',
		key: 'matchmakerExpertise',
		width: 160,
		minWidth: 160,
	},
	{
		title: '红娘性别',
		dataIndex: 'matchmakerGender',
		key: 'matchmakerGender',
		width: 100,
		minWidth: 100,
	},
	{
		title: '红娘所在区域',
		dataIndex: 'matchmakerRegion',
		key: 'matchmakerRegion',
		width: 180,
		minWidth: 180,
	},
	// {
	// 	title: '红娘照片',
	// 	dataIndex: 'matchmakerPhotoUrl',
	// 	key: 'matchmakerPhotoUrl',
	// 	width: 150, minWidth: 150,
	// },
	// {
	// 	title: '红娘微信二维码',
	// 	dataIndex: 'matchmakerWechatQrcodeUrl',
	// 	key: 'matchmakerWechatQrcodeUrl',
	// 	width: 150, minWidth: 150,
	// },
	// offlineServiceProviderVo 全字段（列名以 offlineServiceProviderVo 前缀）
	// 合伙人标识
	{
		title: '合伙人标识',
		dataIndex: 'partnerFlag',
		key: 'partnerFlag',
		width: 100,
		minWidth: 100,
	},
	{
		title: '合伙人名称',
		dataIndex: 'offlineServiceProviderVoName',
		key: 'offlineServiceProviderVoName',
		width: 160,
		minWidth: 160,
	},
	{
		title: '合伙人类型',
		dataIndex: 'offlineServiceProviderVoPartnerTypeName',
		key: 'offlineServiceProviderVoPartnerTypeName',
		width: 200,
		minWidth: 200,
	},
	{
		title: '合伙人开始时间',
		dataIndex: 'offlineServiceProviderVoStartTime',
		key: 'offlineServiceProviderVoStartTime',
		width: 180,
		minWidth: 180,
	},
	{
		title: '合伙人结束时间',
		dataIndex: 'offlineServiceProviderVoEndTime',
		key: 'offlineServiceProviderVoEndTime',
		width: 180,
		minWidth: 180,
	},
	{
		title: '合伙人手机号码',
		dataIndex: 'offlineServiceProviderVoPhoneNumber',
		key: 'offlineServiceProviderVoPhoneNumber',
		width: 180,
		minWidth: 180,
	},
	{
		title: '合伙人需求描述',
		dataIndex: 'offlineServiceProviderVoDemandDescription',
		key: 'offlineServiceProviderVoDemandDescription',
		width: 220,
		minWidth: 220,
	},
	{
		title: '合伙人所在地',
		dataIndex: 'offlineServiceProviderVoResidence',
		key: 'offlineServiceProviderVoResidence',
		width: 180,
		minWidth: 180,
	},
	{
		title: '合伙人单身标识',
		dataIndex: 'offlineServiceProviderVoSingleFlag',
		key: 'offlineServiceProviderVoSingleFlag',
		width: 160,
		minWidth: 160,
	},
]);

export interface DataItem {
	code: string;
	phone: string;
	source: number;
	wechatGzhOpenid?: string;
	identityVerificationName?: string;
	identityVerificationIdCardNumber?: string;
	membershipFlag?: boolean;
	membershipName?: string;
	matchmakerFlag?: boolean;
	partnerFlag?: boolean;
	userMembershipStartTime?: string;
	userMembershipEndTime?: string;
	matchmakerNo?: number;
	matchmakerPositionLevelName?: string;
	matchmakerName?: string;
	matchmakerBirthDate?: string;
	matchmakerContactPhone?: string;
	matchmakerEntryDate?: string;
	matchmakerExpertise?: string;
	matchmakerGender?: string | number;
	matchmakerStatus?: string | number;
	matchmakerRegion?: string;
	matchmakerPhotoUrl?: string;
	matchmakerWechatQrcodeUrl?: string;
	// offlineServiceProviderVo 字段
	offlineServiceProviderVoUserId?: string | number;
	offlineServiceProviderVoType?: string | number;
	offlineServiceProviderVoPartnerType?: string | number;
	offlineServiceProviderVoPartnerTypeName?: string;
	offlineServiceProviderVoStartTime?: string;
	offlineServiceProviderVoEndTime?: string;
	offlineServiceProviderVoStatus?: string | number;
	offlineServiceProviderVoStatusFlag?: boolean;
	offlineServiceProviderVoName?: string;
	offlineServiceProviderVoContactInfo?: string;
	offlineServiceProviderVoPhoneNumber?: string;
	offlineServiceProviderVoDemandDescription?: string;
	offlineServiceProviderVoResidence?: string;
	offlineServiceProviderVoSingleFlag?: boolean;
	offlineServiceProviderVoCode?: string;
	// userProfileInfoVo 字段（用于表格渲染，仅做占位类型）
	userProfileInfoVoNickname?: string;
	userProfileInfoVoGender?: number | string;
	userProfileInfoVoBirthYearMonth?: string;
	userProfileInfoVoHeight?: string | number;
	userProfileInfoVoWeight?: string | number;
	userProfileInfoVoResidenceName?: string;
	userProfileInfoVoMaritalStatusName?: string;
	userProfileInfoVoEducationLevelName?: string;
	userProfileInfoVoProfessionName?: string;
	userProfileInfoVoIncomeStatusName?: string;
	userProfileInfoVoCarHouseStatusName?: string;
	userProfileInfoVoSchoolName?: string;
	userProfileInfoVoEducationTypeName?: string;
	userProfileInfoVoSpecialNote?: string;
	userProfileInfoVoPartnerRequirements?: string;
	userProfileInfoVoLoveView?: string;
	userProfileInfoVoIdealPartner?: string;
	userProfileInfoVoContactPhone?: string;
	userProfileInfoVoZodiac?: string;
	userProfileInfoVoShowPhone?: boolean;
	userProfileInfoVoShowWechat?: boolean;
	userProfileInfoVoAutoExchangeContact?: boolean;
	// 择偶要求（结构化?
	userPartnerPreferencesVo?: {
		id?: string | number;
		userId?: string | number;
		ageFrom?: number;
		ageTo?: number;
		heightFrom?: number;
		heightTo?: number;
		weightFrom?: number;
		weightTo?: number;
		educationLevel?: string;
		educationLevelName?: string;
		profession?: string;
		professionName?: string;
		incomeRange?: string;
		incomeRangeName?: string;
		housingCarStatus?: string;
		housingCarStatusName?: string;
		maritalStatus?: string;
		maritalStatusName?: string;
		location?: string;
		provinceId?: number;
		provinceName?: string;
		cityId?: number;
		cityName?: string;
		districtId?: number;
		districtName?: string;
	};
}

export const getSourceName = (source: number) => {
	switch (source) {
		case 1:
			return '官方来源';
		case 2:
			return '红娘';
		case 3:
			return '婚介所';
		default:
			return '未知';
	}
};